import { history } from 'umi';
import { useEffect } from 'react';
export default function (props: any) {
  useEffect(() => {
    const token = sessionStorage.getItem('token');
    if (!token) {
      history.push('/login');
    }
  });
  return <div>{props.children}</div>;
}
